<!-- 学生缴费 -->
<template>
  <el-card>
    <template #header>
      <div>
        <span>学生缴费列表</span>
      </div>
    </template>

    <!-- 搜索表单 -->
    <el-form class="w-[25rem]">
      <el-form-item label="缴费状态：">
        <el-select placeholder="请选择" v-model="queryParams.type" clearable>
          <el-option label="待缴费" :value="0"></el-option>
          <el-option label="已缴费" :value="1"></el-option>
        </el-select>
      </el-form-item>
    </el-form>

    <!-- 请假表格 -->
    <el-table :data="payList">
      <el-table-column prop="name" label="姓名" align="center" />
      <el-table-column prop="payType" label="缴费类型" align="center">
        <template #default="{ row }">
          <el-tag v-if="row.payType == 0" type="warning">餐费</el-tag>
          <el-tag v-if="row.payType == 1" type="success">学费</el-tag>
          <el-tag v-if="row.payType == 2" type="primary">活动费</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="status" label="审核状态" align="center">
        <template #default="{ row }">
          <el-tag v-if="row.status == 0" type="warning">未缴费</el-tag>
          <el-tag v-if="row.status == 1" type="success">已缴费</el-tag>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" fixed="right">
        <template #default="{ row }">
          <el-button link plain type="success" @click="lookPayInfo(row)">查看</el-button>
        </template>
      </el-table-column>
      <template #empty>
        <el-empty description="没有数据" />
      </template>
    </el-table>
  </el-card>
</template>

<script lang="ts" setup>
import { ref, reactive, onMounted, watch } from "vue";
import { getPayFeesList } from "@/api/payFees/index";

const queryParams = reactive({
  type: 0,
});

const payList = ref<any[]>([]);
const getList = () => {
  getPayFeesList(queryParams.type).then((res: any) => {
    payList.value = res.data.reverse();
  });
};

watch(
  () => queryParams.type,
  () => {
    getList();
  }
);

const lookPayInfo = (row: any) => {};

onMounted(() => {
  getList();
});
</script>

<style lang="scss" scoped></style>
